import json

with open('accusations.json', 'r', encoding='utf-8') as f:
    accusations = []
    max_len = 0
    content = json.load(f)
    for item in content:
        acc = item['text']
        if acc.endswith('选择') or acc.endswith('案由'):
            continue
        if len(acc) > max_len:
            max_len = len(acc)
        accusations.append(acc)
    print(max_len)

    with open('accusations.txt', 'w', encoding='utf-8') as acs:
        for acc in accusations:
            acs.write(acc + '\n')
